#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QPainter>
#include <QLabel>

struct myPoint
{
    QPoint point;
    QPoint movePoint;
};

QT_BEGIN_NAMESPACE
namespace Ui { class Dialog; }
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();
    void CreateMenu();
    void clearData();

protected:
    void paintEvent(QPaintEvent *);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *);
    //void timerEvent(QTimerEvent *event);

public slots:
    void showKeyboard(QPoint pt, QRect focusWidget);
    void hideKeyboard();
    bool isVisible() const;

signals:
    void commit(QString str);
    void delete_signals();

private slots:
    void buttonText_input();
    void delete_button();
    void english_button();
    void number_button();
    void handwriting_button();
    void symbol_button();
    void space_button();

    void input_button();

private:
    Ui::Dialog *ui;
    bool m_bClicked = false;
    bool handwriting = true;
    bool paint_event = false;
    QPoint m_Point;
    QPoint m_movePoint;
    QList<myPoint> pointList;
    char s1[10],s2[10],s3[10],s4[10];
    int biHua = 1;
    int lx = 1;//lian xiang

    QPushButton *close_bt;
    QPushButton *delete_bt;
    QPushButton *input_bt;
    QPushButton *comma_bt;
    QPushButton *period_bt;
    QPushButton *interrogation_bt;
    QPushButton *symbol_bt;
    QPushButton *symbolBt[16];
    QPushButton *handwriting_bt;
    QPushButton *number_bt;
    QPushButton *numBt[12];
    QPushButton *space_bt;
    QPushButton *english_bt;
    QPushButton *englishBt[26];
    QPushButton *exclamation_bt;
};

#endif // DIALOG_H
